# Copyright (c) SandboxAQ. All rights reserved.
# SPDX-License-Identifier: AGPL-3.0-only

load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "sandwich",
    srcs = [
        "sandwich.go",
        "tracing.go",
    ],
    importpath = "github.com/sandbox-quantum/sandwich/go",
    visibility = [
        "//visibility:public",
    ],
    deps = [
        "//go/c",
        "//go/errors",
        "//go/io",
        "//proto:sandwich_go_proto",
        "//proto/api/v1:api_go_proto",
        "@io_opentelemetry_go_otel//:go_default_library",
        "@io_opentelemetry_go_otel//attribute:go_default_library",
        "@io_opentelemetry_go_otel//propagation:go_default_library",
        "@io_opentelemetry_go_otel_sdk//trace:go_default_library",
        "@io_opentelemetry_go_otel_trace//:go_default_library",
        "@io_opentelemetry_go_proto_otlp//common/v1:go_default_library",
        "@io_opentelemetry_go_proto_otlp//trace/v1:go_default_library",
        "@org_golang_google_protobuf//proto:go_default_library",
    ],
)

go_library(
    name = "sandwich+turbo",
    srcs = [
        "sandwich.go",
        "tracing.go",
    ],
    importpath = "github.com/sandbox-quantum/sandwich/go",
    visibility = [
        "//visibility:public",
    ],
    deps = [
        "//go/c:c+turbo",
        "//go/errors:errors+turbo",
        "//go/io:io+turbo",
        "//proto:sandwich_go_proto",
        "//proto/api/v1:api_go_proto",
        "@io_opentelemetry_go_otel//:go_default_library",
        "@io_opentelemetry_go_otel//attribute:go_default_library",
        "@io_opentelemetry_go_otel//propagation:go_default_library",
        "@io_opentelemetry_go_otel_sdk//trace:go_default_library",
        "@io_opentelemetry_go_otel_trace//:go_default_library",
        "@io_opentelemetry_go_proto_otlp//common/v1:go_default_library",
        "@io_opentelemetry_go_proto_otlp//trace/v1:go_default_library",
        "@org_golang_google_protobuf//proto:go_default_library",
    ],
)

go_test(
    name = "sandwich_test",
    timeout = "short",
    srcs = ["sandwich_test.go"],
    data = [
        "//testdata",
    ],
    deps = [
        ":sandwich",
        "//go/errors",
        "//go/tunnel",
        "//proto:sandwich_go_proto",
        "//proto/api/v1:api_go_proto",
        "@io_bazel_rules_go//go/tools/bazel",
        "@io_opentelemetry_go_otel//:go_default_library",
        "@io_opentelemetry_go_otel//attribute:go_default_library",
        "@io_opentelemetry_go_otel//propagation:go_default_library",
        "@io_opentelemetry_go_otel_sdk//trace:go_default_library",
        "@io_opentelemetry_go_otel_trace//:go_default_library",
        "@io_opentelemetry_go_proto_otlp//common/v1:go_default_library",
        "@io_opentelemetry_go_proto_otlp//trace/v1:go_default_library",
    ],
)

go_test(
    name = "tcp_test",
    timeout = "short",
    srcs = ["tcp_test.go"],
    data = [
        "//testdata",
    ],
    deps = [
        ":sandwich",
        "//go/io",
        "//go/tunnel",
        "//proto:sandwich_go_proto",
        "//proto/api/v1:api_go_proto",
        "@io_bazel_rules_go//go/tools/bazel",
        "@io_opentelemetry_go_otel//:go_default_library",
        "@io_opentelemetry_go_otel//attribute:go_default_library",
        "@io_opentelemetry_go_otel//propagation:go_default_library",
        "@io_opentelemetry_go_otel_sdk//trace:go_default_library",
        "@io_opentelemetry_go_otel_trace//:go_default_library",
        "@io_opentelemetry_go_proto_otlp//common/v1:go_default_library",
        "@io_opentelemetry_go_proto_otlp//trace/v1:go_default_library",
    ],
)

go_test(
    name = "turbo_test",
    timeout = "short",
    srcs = ["turbo_test.go"],
    data = [
        "//testdata",
    ],
    deps = [
        ":sandwich+turbo",
        "//go/io:io+turbo",
        "//go/tunnel:tunnel+turbo",
        "//proto:sandwich_go_proto",
        "//proto/api/v1:api_go_proto",
        "@io_bazel_rules_go//go/tools/bazel",
        "@io_opentelemetry_go_otel//:go_default_library",
        "@io_opentelemetry_go_otel//attribute:go_default_library",
        "@io_opentelemetry_go_otel//propagation:go_default_library",
        "@io_opentelemetry_go_otel_sdk//trace:go_default_library",
        "@io_opentelemetry_go_otel_trace//:go_default_library",
        "@io_opentelemetry_go_proto_otlp//common/v1:go_default_library",
        "@io_opentelemetry_go_proto_otlp//trace/v1:go_default_library",
    ],
)
